﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

using MT.eVotePRS.Model;
using MT.eVotePRS.Persistence.Interfaces;

namespace MT.eVotePRS.Persistence.MapperDao
{
    public class InventoryTxnSqlMapDao : BaseMapDao, IInventoryTxnDao
    {
        public object InsertInventoryTxn(InventoryTxn inventoryTxn)
        {
            return ExecuteInsert("InsertInventoryTxn", inventoryTxn );
        }

        public InventoryTxn QueryLastTxnOfHandset(string handsetId)
        {
            return (ExecuteQueryForObject("QueryInventoryTxnLastStatusHandset", handsetId)) as InventoryTxn;
        }

        public InventoryTxn QueryLastTxnOfStudent(string studentId)
        {
            return (ExecuteQueryForObject("QueryInventoryTxnLastStatusStudent", studentId) as InventoryTxn);
        }

        public IList GetTxnByHandsetId(string handsetId)
        {
            return ExecuteQueryForList("GetInventoryTxnsByHandsetID", handsetId);
        }

        public IList GetTxnByStudentID(string studentId)
        {
            return ExecuteQueryForList("GetInventoryTxnsByStudentID", studentId);
        }

        public IList GetAllTxnList()
        {
            return ExecuteQueryForList("SelectAllInventoryTxn", null);
        }

        public IList GetStudentEventsByStatus(int statusId)
        {
            return ExecuteQueryForList("QueryStudentEventsByStatus", statusId);
        }

        public IList GetHandsetEventsByStatus(int statusId)
        {
            return ExecuteQueryForList("QueryHandsetEventsByStatus", statusId);
        }

        public IList GetStudentEvents(Hashtable paramHash)
        {
            return ExecuteQueryForList("QueryStudentEvents", paramHash);
        }

        public IList GetHandsetEvents(Hashtable paramHash)
        {
            return ExecuteQueryForList("QueryHandsetEvents", paramHash);
        }
    }
}
